package com.cn.yds.bdy.utils;

import org.springframework.util.Assert;

import java.util.Calendar;
import java.util.Date;

public class ComentUtils {


    public static void isTrueExecute(boolean con, Runnable runnable ){
        if(con){
            runnable.run();
        }
    }

    public static int getMonth(Date date){
        Assert.notNull(date,"Can't get the month from a empty date!");
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        return cal.get(Calendar.MONTH) + 1;
    }

}
